<?php
/**
 * Created by PhpStorm.
 * User: 周超
 * Date: 2016/11/17
 * Time: 17:50
 */

namespace App\Http\Routes;

use Illuminate\Contracts\Routing\Registrar;
class TypesBackRoute
{
    public function map(Registrar $router)
    {
        $router->group(['middleware' =>  ['web','auth','permissions.check'],
            'prefix' => 'backstage/types',], function ($router) {
            $router->get('list',['uses' =>'Backstage\TypesController@getList'])->name('get.types.list');
            $router->get('update/{type_id}',['uses' =>'Backstage\TypesController@getUpdate'])->name('get.types.list.update');
            $router->get('add',['uses' =>'Backstage\TypesController@getAdd'])->name('get.types.list.add');
            $router->post('add',['uses' =>'Backstage\TypesController@postAdd'])->name('post.types.list.add');
            $router->post('update',['uses' =>'Backstage\TypesController@postUpdate'])->name('post.types.list.update');
            $router->get('delete/{type_id}',['uses' =>'Backstage\TypesController@getDelete'])->name('get.types.list.delete');
            $router->post('update-sort',['uses' =>'Backstage\TypesController@postUpdateSort'])->name('post.types.list.update-sort');
            $router->post('show',['uses' =>'Backstage\TypesController@postUpsateShow'])->name('post.types.list.show');
            $router->post('search',['uses' =>'Backstage\TypesController@postSearch'])->name('post.types.list.search');
            $router->get('product-list/{type_id}',['uses' =>'Backstage\TypesController@getProductList'])->name('get.types.list.product-list');
            $router->get('add-product/{type_id}',['uses' =>'Backstage\TypesController@getAddProduct'])->name('get.types.list.add-product');
            $router->post('add-product',['uses' =>'Backstage\TypesController@postAddProduct'])->name('post.types.list.add-product');
            $router->get('delete-product/{type_id}/{product_id}',['uses' =>'Backstage\TypesController@getDeleteProduct'])->name('get.types.list.delete-product');
            $router->get('update-product-sort',['uses' =>'Backstage\TypesController@getUpdateProductSort'])->name('get.types.list.update-product-sort');
        });
    }
}